import { request, post, get } from "@/utils/request";
import axios from 'axios'

class integralApi {
  /**
  * @description: 获取积分明细的统计数据
  * @param {*}
  * @return {*}
  */
  getStatistics(data) {
    let url = `/community/back/currency/statistics`
    return request(url, data)
  }

  /**
  * @description: 增减消耗积分
  * @param {*} 	 type修改积分类型 0增 1减 2消耗
  * @return {*}
  */
  updateIntegral(data) {
    let url = `/community/back/currency/updateIntegral`
    return request(url, data)
  }

  /**
  * @description: 下载导入模板
  * @param {*} 	
  * @return {*}
  */
  getIntegraTemplate() {
    let url = `/community/back/import/downExcelTemplate`
    return request(url, {responseType: "blob"})
  }
  /**
    * @description: 积分导入
    * @param {*} 	
    * @return {*}
    */
  exportExcel(data) {
    let url = `/community/back/import/import`
    return request(url, data)
  }

  /**
  * @description: 员工状态修改
  * @param {*} 	
  * @return {*}
  */
  customerUpdateStatus(data) {
    let url = `/community/back/userExt/updateStatus`
    return request(url, data)
  }



  /**
  * @description: 获取勋章信息
  * @param {*} 	
  * @return {*}
  */
  getPageMedal(data) {
    let url = `/community/back/medalInfo/getMedal`
    return request(url, data)
  }

  /**
 * @description: 获取用户已拥有的勋章
 * @param {*} 	
 * @return {*}
 */
  getUserMedals(data) {
    let url = `/community/back/userMedal/userMedals`
    return request(url, data)
  }


  /**
  * @description: 颁发勋章
  * @param {*} 	
  * @return {*}
  */
  setAwardMedal(data) {
    let url = `/community/back/userMedal/awardMedal`
    return request(url, data)
  }

  /**
  * @description: 新增勋章
  * @param {*} 	
  * @return {*}
  */
  addMedalInfo(data) {
    let url = `/community/back/medalInfo/addMedalInfo`
    return request(url, data)
  }

  /**
    * @description: 删除勋章信息
    * @param {*} 	
    * @return {*}
    */
  deleteMedal(data) {
    let url = `/community/back/medalInfo/deleteMedal`
    return request(url, data)
  }

  /**
    * @description: 启用/停用勋章信息
    * @param {*} 	
    * @return {*}
    */
  setEnableMedal(data) {
    let url = `/community/back/medalInfo/enableMedal`
    return request(url, data)
  }

  /**
  * @description: 启用/停用任务
  * @param {*} 	
  * @return {*}
  */
  setAvailable(data) {
    let url = `/community/back/dailyTask/available`
    return request(url, data)
  }

  /**
  * @description: 新增/修改任务信息
  * @param {*} 	
  * @return {*}
  */
  addTask(data) {
    let url = `/community/back/dailyTask/addTask`
    return request(url, data)
  }

  /**
  * @description: 设为首席
  * @param {*} 	
  * @return {*}
  */
   updateChief(data) {
    let url = `/community/back/userExt/updateChief`
    return request(url, data)
  }


  /**
  * @description: 同步数据
  * @param {*} 	
  * @return {*}
  */
   setSynchronous() {
    let url = `/community/back/userExt/sync`
    return request(url)
  }


  /**
  * @description: 导出签到
  * @param {*} 	
  * @return {*}
  */
   exportSigin(data) {
    let url = `/community/back/signIn/exportSignIn`
    return request(url,data, {responseType: "blob"})
  }

  /**
  * @description: 导出签退
  * @param {*} 	
  * @return {*}
  */
   exportSignOut(data) {
    let url = `/community/back/signIn/exportSignOut`
    return request(url,data, {responseType: "blob"})
  }

  /**
  * @description: 导出任务
  * @param {*} 	
  * @return {*}
  */
   exportUserTask(data) {
    let url = `/community/back/signIn/exportUserTask`
    return request(url,data, {responseType: "blob"})
  }
  
}
export default new integralApi()
